package com.nf.recruitment.controller;

import com.nf.recruitment.dto.CandidateDTO;
import com.nf.recruitment.dto.CandidatePageDTO;
import com.nf.recruitment.entity.Candidate;
import com.nf.recruitment.entity.City;
import com.nf.recruitment.entity.Provincial;
import com.nf.recruitment.service.CityService;
import com.nf.recruitment.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/city")
public class CityController extends BaseController{
    @Autowired
    private CityService service;

    @GetMapping("/provincial")
    public ResultVO<List<Provincial>> listProvincial() {
        List<Provincial> provincials = service.listProvince();
        return new ResultVO<>(200,"获取成功",provincials);
    }
    @GetMapping("/list")
    public ResultVO<List<City>> listProvincial(@RequestParam("provincialId") long provincialId) {
        List<City> cityByProvincial = service.getCityByProvincial(provincialId);
        return new ResultVO<>(200,"获取成功",cityByProvincial);
    }

}
